<?php

use App\Http\Controllers\AppController;
use App\Http\Controllers\ScanController;
use App\Http\Controllers\TestController;
use App\Http\Controllers\WeChatController;
use App\Http\Controllers\WxPayController;
use Illuminate\Support\Facades\Route;
use Kuyuan\Phpwidget\Str;

/**
 * 后台管理
 */
Route::get('/', function () {
    return view('admin');
});

/**
 * 客户端入口
 */
Route::get('/app',[AppController::class,"index"])->name('app');

/**
 * 微信通信
 */
Route::any('/wechat', [WechatController::class,'serve']);

/**
 * 微信登录授权
 */
Route::get('/wechat_oauth', [WechatController::class,'oauth']);

/**
 * 扫码处理
 */
Route::get('/scan', [ScanController::class, 'index'])->name('scan');

/**
 * 支付回调
 */
Route::group(['prefix'=>'wxpay'], function() {
    Route::post('/send_red', [WxPayController::class, 'sendRed'])->name('notifySendRed');
});







/**
 * 测试获取微信登录授权码
 */
Route::get('/get_code', function(\Illuminate\Http\Request $request) {
    echo $request->input('code');
    exit;
});

Route::get('/test', [TestController::class,'index']);

